package com.tanhua.model.vo;
import com.tanhua.model.db.Nair;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class NairVo implements Serializable {

    private String id;//问卷编号
    private String name;//问卷名称
    private String cover;//问卷封面
    private String level;//级别(初中高)
    private Integer star;//星别
    private List<TopicVo> questions;//题目(需要用选项以及选项编号构建)
    private Integer isLock;//是否锁住(0解锁 1锁住)
    private String reportId;//最新报告id

    public static NairVo init(Nair nair) {
        NairVo vo = new NairVo();
        BeanUtils.copyProperties(nair,vo);
        vo.setId(nair.getNairId().toString());
        vo.setName(nair.getNairName());
        return vo;
    }
}
